Ext.define("jwawa.erp.cfg.searchPage.SearchItemHelper", {
    afterDelSerchItem: function(itemId){
        "use strict";
        var me = this,
            searchItemStore = Ext.JwawaResMgr.get('searchItemStore');

        var curItem = searchItemStore.getById(itemId),
            idx = searchItemStore.indexOf(curItem),
            lastIdx = searchItemStore.indexOf(searchItemStore.last());

        if(lastIdx >= idx + 1){
            var searchItems = searchItemStore.getRange(idx + 1, lastIdx);
            Ext.each(searchItems, function(searchItem){
                searchItem.set('seq', searchItem.get('seq') - 1);
                searchItem.commit();
            });
        }
        searchItemStore.remove(curItem);
        searchItemStore.sort();
        top.msgBar.showSuccessMsg('删除指定检索页明细成功');
    }
});